﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using AppToolKit.Model.Validation.Attribute;
using AppToolKit.Model;

namespace App.Contract
{
    #region BlockHeader

    /// <summary>
    /// BlockHeader object for NHibernate mapped table 'block_header'.
    /// </summary>
    [Serializable]
    public class BlockHeaderVO : EntityBase
    {
        #region const Variables
        #region const FIEID
        public const string TABLE_NAME = "block_header";

        public const string BLOCKCODE_COLUMN = "blockcode";
        public const string BLOCKNAME_COLUMN = "blockname";
        public const string HOTELID_COLUMN = "hotelid";
        public const string HACCNT_COLUMN = "haccnt";
        public const string CUSNO_COLUMN = "cusno";
        public const string AGENT_COLUMN = "agent";
        public const string SOURCE_COLUMN = "source";
        public const string STA_COLUMN = "sta";
        public const string BOOKINGSTATUS_COLUMN = "bookingstatus";
        public const string STARTDATE_COLUMN = "start_date";
        public const string ENDDATE_COLUMN = "end_date";
        public const string RATECODE_COLUMN = "ratecode";
        public const string RATE1_COLUMN = "rate1";
        public const string RATE2_COLUMN = "rate2";
        public const string RATE3_COLUMN = "rate3";
        public const string RATE4_COLUMN = "rate4";
        public const string CHILD_COLUMN = "child";
        public const string ADDBED_COLUMN = "addbed";
        public const string GSTNO_COLUMN = "gstno";
        public const string CHILDREN_COLUMN = "children";
        public const string PROJECTEDOCC1_COLUMN = "projectedocc1";
        public const string PROJECTEDOCC2_COLUMN = "projectedocc2";
        public const string PROJECTEDOCC3_COLUMN = "projectedocc3";
        public const string PROJECTEDOCC4_COLUMN = "projectedocc4";
        public const string CUTOFFDATE_COLUMN = "cutoffdate";
        public const string CUSTOFFDAYS_COLUMN = "custoffdays";
        public const string MASTERBLOCK_COLUMN = "masterblock";
        public const string MASTERBLOCKCODE_COLUMN = "masterblockcode";
        public const string MKTCODE_COLUMN = "mktcode";
        public const string SRCCODE_COLUMN = "srccode";
        public const string CHANNELCODE_COLUMN = "channel_code";
        public const string PMSBLOCKID_COLUMN = "pmsblockid";
        public const string PACKAGECODE_COLUMN = "packagecode";
        public const string PAYMENT_COLUMN = "payment";
        public const string RSVTYPE_COLUMN = "rsvtype";
        public const string WEEK_COLUMN = "week";
        public const string EXPS1_COLUMN = "exp_s1";
        public const string EXPS2_COLUMN = "exp_s2";
        public const string EXPS3_COLUMN = "exp_s3";
        public const string EXPS4_COLUMN = "exp_s4";
        public const string EXPS5_COLUMN = "exp_s5";
        public const string CREATEDATE_COLUMN = "createdate";
        public const string CREATOR_COLUMN = "creator";
        public const string CHANGED_COLUMN = "changed";
        public const string CHANGEDBY_COLUMN = "changedby";
        public const string LOGMARK_COLUMN = "logmark";
        public const string QUEUESTATUS_COLUMN = "queuestatus";


        public const string ID_FIELD = "Id";
        public const string BLOCKNAME_FIELD = "Blockname";
        public const string HOTELID_FIELD = "Hotelid";
        public const string HACCNT_FIELD = "Haccnt";
        public const string CUSNO_FIELD = "Cusno";
        public const string AGENT_FIELD = "Agent";
        public const string SOURCE_FIELD = "Source";
        public const string STA_FIELD = "Sta";
        public const string BOOKINGSTATUS_FIELD = "Bookingstatus";
        public const string STARTDATE_FIELD = "StartDate";
        public const string ENDDATE_FIELD = "EndDate";
        public const string RATECODE_FIELD = "Ratecode";
        public const string RATE1_FIELD = "Rate1";
        public const string RATE2_FIELD = "Rate2";
        public const string RATE3_FIELD = "Rate3";
        public const string RATE4_FIELD = "Rate4";
        public const string CHILD_FIELD = "Child";
        public const string ADDBED_FIELD = "Addbed";
        public const string GSTNO_FIELD = "Gstno";
        public const string CHILDREN_FIELD = "Children";
        public const string PROJECTEDOCC1_FIELD = "Projectedocc1";
        public const string PROJECTEDOCC2_FIELD = "Projectedocc2";
        public const string PROJECTEDOCC3_FIELD = "Projectedocc3";
        public const string PROJECTEDOCC4_FIELD = "Projectedocc4";
        public const string CUTOFFDATE_FIELD = "Cutoffdate";
        public const string CUSTOFFDAYS_FIELD = "Cutoffdays";
        public const string MASTERBLOCK_FIELD = "Masterblock";
        public const string MASTERBLOCKCODE_FIELD = "Masterblockcode";
        public const string MKTCODE_FIELD = "Mktcode";
        public const string SRCCODE_FIELD = "Srccode";
        public const string CHANNELCODE_FIELD = "ChannelCode";
        public const string PMSBLOCKID_FIELD = "Pmsblockid";
        public const string PACKAGECODE_FIELD = "Packagecode";
        public const string PAYMENT_FIELD = "Payment";
        public const string RSVTYPE_FIELD = "Rsvtype";
        public const string WEEK_FIELD = "Week";
        public const string EXPS1_FIELD = "ExpS1";
        public const string EXPS2_FIELD = "ExpS2";
        public const string EXPS3_FIELD = "ExpS3";
        public const string EXPS4_FIELD = "ExpS4";
        public const string EXPS5_FIELD = "ExpS5";
        public const string CREATEDATE_FIELD = "Createdate";
        public const string CREATOR_FIELD = "Creator";
        public const string CHANGED_FIELD = "Changed";
        public const string CHANGEDBY_FIELD = "Changedby";
        public const string LOGMARK_FIELD = "Logmark";
        public const string QUEUESTATUS_FIELD = "Queuestatus";
        #endregion

        #endregion


        #region Member Variables

        private string _id;
        private string _blockname;
        private string _blockname1;
        private string _hotelid;
        private string _haccnt;
        private string _cusno;
        private string _agent;
        private string _source;
        private string _sta;
        private string _bookingstatus;
        private DateTime _startdate;
        private DateTime _enddate;
        private string _ratecode;
        private decimal? _rate1;
        private decimal? _rate2;
        private decimal? _rate3;
        private decimal? _rate4;
        private decimal? _child;
        private decimal? _addbed;
        private int _gstno;
        private int _children;
        private int? _projectedocc1;
        private int? _projectedocc2;
        private int? _projectedocc3;
        private int? _projectedocc4;
        private DateTime? _cutoffdate;
        private int? _custoffdays;
        private string _masterblock;
        private string _masterblockcode;
        private string _mktcode;
        private string _srccode;
        private string _channelcode;
        private string _pmsblockid;
        private string _packagecode;
        private string _payment;
        private string _rsvtype;
        private string _week;
        private string _exps1;
        private string _exps2;
        private string _exps3;
        private string _exps4;
        private string _exps5;
        private DateTime _createdate;
        private string _creator;
        private DateTime? _changed;
        private string _changedby;
        private int _logmark;
        private string _queuestatus;


        #endregion

        #region Constructors

        public BlockHeaderVO() { }



        #endregion

        #region Public Properties

       // [FieldDescript("PMSBusiness.Contract.Sales.Block.Model.Resource.BlockHeaderEntityResource", "Id")]
        [StrLengthRule(10)]
        [RequireRule]
        public virtual string Id
        {
            get { return _id; }
            set { _id = value; }
        }

       // [FieldDescript("PMSBusiness.Contract.Sales.Block.Model.Resource.BlockHeaderEntityResource", "Blockname")]
        [StrLengthRule(100)]
        [RequireRule]
        public virtual string Blockname
        {
            get { return _blockname; }
            set { _blockname = value; }
        }
        [StrLengthRule(100)]
        public virtual string Blockname1
        {
            get { return _blockname1; }
            set { _blockname1 = value; }
        }
       // [FieldDescript("PMSBusiness.Contract.Sales.Block.Model.Resource.BlockHeaderEntityResource", "Hotelid")]
        [StrLengthRule(20)]
        [RequireRule]
        public virtual string Hotelid
        {
            get { return _hotelid; }
            set { _hotelid = value; }
        }

       // [FieldDescript("PMSBusiness.Contract.Sales.Block.Model.Resource.BlockHeaderEntityResource", "Haccnt")]
        public virtual string Haccnt
        {
            get { return _haccnt; }
            set { _haccnt = value; }
        }

       // [FieldDescript("PMSBusiness.Contract.Sales.Block.Model.Resource.BlockHeaderEntityResource", "Cusno")]
        public virtual string Cusno
        {
            get { return _cusno; }
            set { _cusno = value; }
        }

       // [FieldDescript("PMSBusiness.Contract.Sales.Block.Model.Resource.BlockHeaderEntityResource", "Agent")]
        public virtual string Agent
        {
            get { return _agent; }
            set { _agent = value; }
        }

       // [FieldDescript("PMSBusiness.Contract.Sales.Block.Model.Resource.BlockHeaderEntityResource", "Source")]
        public virtual string Source
        {
            get { return _source; }
            set { _source = value; }
        }

       // [FieldDescript("PMSBusiness.Contract.Sales.Block.Model.Resource.BlockHeaderEntityResource", "Sta")]
        [StrLengthRule(1)]
        [RequireRule]
        public virtual string Sta
        {
            get { return _sta; }
            set { _sta = value; }
        }

       // [FieldDescript("PMSBusiness.Contract.Sales.Block.Model.Resource.BlockHeaderEntityResource", "Bookingstatus")]
        public virtual string Bookingstatus
        {
            get { return _bookingstatus; }
            set { _bookingstatus = value; }
        }

       // [FieldDescript("PMSBusiness.Contract.Sales.Block.Model.Resource.BlockHeaderEntityResource", "StartDate")]
        [RequireRule]
        public virtual DateTime StartDate
        {
            get { return _startdate; }
            set { _startdate = value; }
        }

       // [FieldDescript("PMSBusiness.Contract.Sales.Block.Model.Resource.BlockHeaderEntityResource", "EndDate")]
        [RequireRule]
        public virtual DateTime EndDate
        {
            get { return _enddate; }
            set { _enddate = value; }
        }

       // [FieldDescript("PMSBusiness.Contract.Sales.Block.Model.Resource.BlockHeaderEntityResource", "Ratecode")]
        public virtual string Ratecode
        {
            get { return _ratecode; }
            set { _ratecode = value; }
        }

       // [FieldDescript("PMSBusiness.Contract.Sales.Block.Model.Resource.BlockHeaderEntityResource", "Rate1")]
        public virtual decimal? Rate1
        {
            get { return _rate1; }
            set { _rate1 = value; }
        }

       // [FieldDescript("PMSBusiness.Contract.Sales.Block.Model.Resource.BlockHeaderEntityResource", "Rate2")]
        public virtual decimal? Rate2
        {
            get { return _rate2; }
            set { _rate2 = value; }
        }

       // [FieldDescript("PMSBusiness.Contract.Sales.Block.Model.Resource.BlockHeaderEntityResource", "Rate3")]
        public virtual decimal? Rate3
        {
            get { return _rate3; }
            set { _rate3 = value; }
        }

       // [FieldDescript("PMSBusiness.Contract.Sales.Block.Model.Resource.BlockHeaderEntityResource", "Rate4")]
        public virtual decimal? Rate4
        {
            get { return _rate4; }
            set { _rate4 = value; }
        }

       // [FieldDescript("PMSBusiness.Contract.Sales.Block.Model.Resource.BlockHeaderEntityResource", "Child")]
        public virtual decimal? Child
        {
            get { return _child; }
            set { _child = value; }
        }

       // [FieldDescript("PMSBusiness.Contract.Sales.Block.Model.Resource.BlockHeaderEntityResource", "Addbed")]
        public virtual decimal? Addbed
        {
            get { return _addbed; }
            set { _addbed = value; }
        }

       // [FieldDescript("PMSBusiness.Contract.Sales.Block.Model.Resource.BlockHeaderEntityResource", "Gstno")]
        [RequireRule]
        public virtual int Gstno
        {
            get { return _gstno; }
            set { _gstno = value; }
        }

       // [FieldDescript("PMSBusiness.Contract.Sales.Block.Model.Resource.BlockHeaderEntityResource", "Children")]
        [RequireRule]
        public virtual int Children
        {
            get { return _children; }
            set { _children = value; }
        }

       // [FieldDescript("PMSBusiness.Contract.Sales.Block.Model.Resource.BlockHeaderEntityResource", "Projectedocc1")]
        public virtual int? Projectedocc1
        {
            get { return _projectedocc1; }
            set { _projectedocc1 = value; }
        }

       // [FieldDescript("PMSBusiness.Contract.Sales.Block.Model.Resource.BlockHeaderEntityResource", "Projectedocc2")]
        public virtual int? Projectedocc2
        {
            get { return _projectedocc2; }
            set { _projectedocc2 = value; }
        }

       // [FieldDescript("PMSBusiness.Contract.Sales.Block.Model.Resource.BlockHeaderEntityResource", "Projectedocc3")]
        public virtual int? Projectedocc3
        {
            get { return _projectedocc3; }
            set { _projectedocc3 = value; }
        }

       // [FieldDescript("PMSBusiness.Contract.Sales.Block.Model.Resource.BlockHeaderEntityResource", "Projectedocc4")]
        public virtual int? Projectedocc4
        {
            get { return _projectedocc4; }
            set { _projectedocc4 = value; }
        }

       // [FieldDescript("PMSBusiness.Contract.Sales.Block.Model.Resource.BlockHeaderEntityResource", "Cutoffdate")]
        public virtual DateTime? Cutoffdate
        {
            get { return _cutoffdate; }
            set { _cutoffdate = value; }
        }

       // [FieldDescript("PMSBusiness.Contract.Sales.Block.Model.Resource.BlockHeaderEntityResource", "Custoffdays")]
        public virtual int? Cutoffdays
        {
            get { return _custoffdays; }
            set { _custoffdays = value; }
        }

       // [FieldDescript("PMSBusiness.Contract.Sales.Block.Model.Resource.BlockHeaderEntityResource", "Masterblock")]
        public virtual string Masterblock
        {
            get { return _masterblock; }
            set { _masterblock = value; }
        }

       // [FieldDescript("PMSBusiness.Contract.Sales.Block.Model.Resource.BlockHeaderEntityResource", "Masterblockcode")]
        public virtual string Masterblockcode
        {
            get { return _masterblockcode; }
            set { _masterblockcode = value; }
        }

       // [FieldDescript("PMSBusiness.Contract.Sales.Block.Model.Resource.BlockHeaderEntityResource", "Mktcode")]
        [StrLengthRule(3)]
        [RequireRule]
        public virtual string Mktcode
        {
            get { return _mktcode; }
            set { _mktcode = value; }
        }

       // [FieldDescript("PMSBusiness.Contract.Sales.Block.Model.Resource.BlockHeaderEntityResource", "Srccode")]
        [StrLengthRule(3)]
        [RequireRule]
        public virtual string Srccode
        {
            get { return _srccode; }
            set { _srccode = value; }
        }

       // [FieldDescript("PMSBusiness.Contract.Sales.Block.Model.Resource.BlockHeaderEntityResource", "ChannelCode")]
        [RequireRule]
        [RequireRule]
        public virtual string ChannelCode
        {
            get { return _channelcode; }
            set { _channelcode = value; }
        }

       // [FieldDescript("PMSBusiness.Contract.Sales.Block.Model.Resource.BlockHeaderEntityResource", "Pmsblockid")]
        public virtual string Pmsblockid
        {
            get { return _pmsblockid; }
            set { _pmsblockid = value; }
        }

       // [FieldDescript("PMSBusiness.Contract.Sales.Block.Model.Resource.BlockHeaderEntityResource", "Packagecode")]
        public virtual string Packagecode
        {
            get { return _packagecode; }
            set { _packagecode = value; }
        }

       // [FieldDescript("PMSBusiness.Contract.Sales.Block.Model.Resource.BlockHeaderEntityResource", "Payment")]
        public virtual string Payment
        {
            get { return _payment; }
            set { _payment = value; }
        }

       // [FieldDescript("PMSBusiness.Contract.Sales.Block.Model.Resource.BlockHeaderEntityResource", "Rsvtype")]
        [RequireRule]
        public virtual string Rsvtype
        {
            get { return _rsvtype; }
            set { _rsvtype = value; }
        }

       // [FieldDescript("PMSBusiness.Contract.Sales.Block.Model.Resource.BlockHeaderEntityResource", "Week")]
        public virtual string Week
        {
            get { return _week; }
            set { _week = value; }
        }

       // [FieldDescript("PMSBusiness.Contract.Sales.Block.Model.Resource.BlockHeaderEntityResource", "ExpS1")]
        public virtual string ExpS1
        {
            get { return _exps1; }
            set { _exps1 = value; }
        }

       // [FieldDescript("PMSBusiness.Contract.Sales.Block.Model.Resource.BlockHeaderEntityResource", "ExpS2")]
        public virtual string ExpS2
        {
            get { return _exps2; }
            set { _exps2 = value; }
        }

       // [FieldDescript("PMSBusiness.Contract.Sales.Block.Model.Resource.BlockHeaderEntityResource", "ExpS3")]
        public virtual string ExpS3
        {
            get { return _exps3; }
            set { _exps3 = value; }
        }

       // [FieldDescript("PMSBusiness.Contract.Sales.Block.Model.Resource.BlockHeaderEntityResource", "ExpS4")]
        public virtual string ExpS4
        {
            get { return _exps4; }
            set { _exps4 = value; }
        }

       // [FieldDescript("PMSBusiness.Contract.Sales.Block.Model.Resource.BlockHeaderEntityResource", "ExpS5")]
        public virtual string ExpS5
        {
            get { return _exps5; }
            set { _exps5 = value; }
        }

       // [FieldDescript("PMSBusiness.Contract.Sales.Block.Model.Resource.BlockHeaderEntityResource", "Createdate")]
        [RequireRule]
        public virtual DateTime Createdate
        {
            get { return _createdate; }
            set { _createdate = value; }
        }

       // [FieldDescript("PMSBusiness.Contract.Sales.Block.Model.Resource.BlockHeaderEntityResource", "Creator")]
        [StrLengthRule(20)]
        [RequireRule]
        public virtual string Creator
        {
            get { return _creator; }
            set { _creator = value; }
        }

       // [FieldDescript("PMSBusiness.Contract.Sales.Block.Model.Resource.BlockHeaderEntityResource", "Changed")]
        public virtual DateTime? Changed
        {
            get { return _changed; }
            set { _changed = value; }
        }

       // [FieldDescript("PMSBusiness.Contract.Sales.Block.Model.Resource.BlockHeaderEntityResource", "Changedby")]
        public virtual string Changedby
        {
            get { return _changedby; }
            set { _changedby = value; }
        }

       // [FieldDescript("PMSBusiness.Contract.Sales.Block.Model.Resource.BlockHeaderEntityResource", "Logmark")]
        [RequireRule]
        public virtual int Logmark
        {
            get { return _logmark; }
            set { _logmark = value; }
        }

       // [FieldDescript("PMSBusiness.Contract.Sales.Block.Model.Resource.BlockHeaderEntityResource", "Queuestatus")]
        public virtual string Queuestatus
        {
            get { return _queuestatus; }
            set { _queuestatus = value; }
        }

        public virtual int Days
        {
            get
            {
                if (StartDate != null && EndDate != null)
                    return (EndDate - StartDate).Days;
                else
                    return 1;
            }
        }
        public override object Key
        {
            get { return Id; }
        }

        #endregion

    }
    #endregion
}
